Optimal. Leaf size=75 \[ \frac {a x}{(c-i d)^2}-\frac {i a \log (c \cos (e+f x)+d \sin (e+f x))}{(c-i d)^2 f}-\frac {a}{(i c+d) f (c+d \tan (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 3, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.115, Rules used = {3610, 3612,
3611} \begin {gather*} -\frac {a}{f (d+i c) (c+d \tan (e+f x))}-\frac {i a \log (c \cos (e+f x)+d \sin (e+f x))}{f (c-i d)^2}+\frac {a x}{(c-i d)^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3610
Rule 3611
Rule 3612
Rubi steps
\begin {align*} \int \frac {a+i a \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx &=-\frac {a}{(i c+d) f (c+d \tan (e+f x))}+\frac {\int \frac {a (c+i d)+a (i c-d) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{c^2+d^2}\\ &=\frac {a x}{(c-i d)^2}-\frac {a}{(i c+d) f (c+d \tan (e+f x))}-\frac {(i a) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{(c-i d)^2}\\ &=\frac {a x}{(c-i d)^2}-\frac {i a \log (c \cos (e+f x)+d \sin (e+f x))}{(c-i d)^2 f}-\frac {a}{(i c+d) f (c+d \tan (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(302\) vs. \(2(75)=150\).
time = 2.48, size = 302, normalized size = 4.03 \begin {gather*} \frac {\cos (e+f x) (\cos (e)-i \sin (e)) (\cos (f x)-i \sin (f x)) \left (4 \text {ArcTan}\left (\frac {2 c d \cos (2 e+f x)+\left (-c^2+d^2\right ) \sin (2 e+f x)}{\left (c^2-d^2\right ) \cos (2 e+f x)+2 c d \sin (2 e+f x)}\right )+\frac {\left (c^2+d^2\right ) \cos (f x) \left (4 f x-i \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )\right )+\left (c^2-d^2\right ) \cos (2 e+f x) \left (4 f x-i \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )\right )-2 d \left (2 (i c+d) \sin (f x)+c \left (-4 f x+i \log \left ((c \cos (e+f x)+d \sin (e+f x))^2\right )\right ) \sin (2 e+f x)\right )}{(c \cos (e)+d \sin (e)) (c \cos (e+f x)+d \sin (e+f x))}\right ) (a+i a \tan (e+f x))}{4 (c-i d)^2 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.24, size = 139, normalized size = 1.85
method | result | size |
derivativedivides | \(\frac {a \left (\frac {i c -d}{\left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )}-\frac {\left (i c^{2}-i d^{2}-2 c d \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}+\frac {\frac {\left (i c^{2}-i d^{2}-2 c d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (2 i c d +c^{2}-d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}\right )}{f}\) | \(139\) |
default | \(\frac {a \left (\frac {i c -d}{\left (c^{2}+d^{2}\right ) \left (c +d \tan \left (f x +e \right )\right )}-\frac {\left (i c^{2}-i d^{2}-2 c d \right ) \ln \left (c +d \tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}+\frac {\frac {\left (i c^{2}-i d^{2}-2 c d \right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}+\left (2 i c d +c^{2}-d^{2}\right ) \arctan \left (\tan \left (f x +e \right )\right )}{\left (c^{2}+d^{2}\right )^{2}}\right )}{f}\) | \(139\) |
norman | \(\frac {\frac {a c x}{\left (-i d +c \right )^{2}}-\frac {i a d \tan \left (f x +e \right )}{f \left (-i d +c \right ) c}-\frac {a d x \tan \left (f x +e \right )}{\left (i c +d \right )^{2}}}{c +d \tan \left (f x +e \right )}+\frac {i a \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f \left (-2 i c d +c^{2}-d^{2}\right )}-\frac {i a \ln \left (c +d \tan \left (f x +e \right )\right )}{f \left (-2 i c d +c^{2}-d^{2}\right )}\) | \(140\) |
risch | \(-\frac {2 a x}{2 i c d -c^{2}+d^{2}}-\frac {2 i a x}{i c^{2}-i d^{2}+2 c d}-\frac {2 i a e}{f \left (i c^{2}-i d^{2}+2 c d \right )}-\frac {2 i a d}{f \left (i c +d \right )^{2} \left ({\mathrm e}^{2 i \left (f x +e \right )} d +i c \,{\mathrm e}^{2 i \left (f x +e \right )}-d +i c \right )}+\frac {a \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right )}{f \left (i c^{2}-i d^{2}+2 c d \right )}\) | \(176\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Both result and optimal contain complex but leaf count of result is larger than
twice the leaf count of optimal. 184 vs. \(2 (70) = 140\).
time = 0.51, size = 184, normalized size = 2.45 \begin {gather*} \frac {\frac {2 \, {\left (a c^{2} + 2 i \, a c d - a d^{2}\right )} {\left (f x + e\right )}}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac {2 \, {\left (-i \, a c^{2} + 2 \, a c d + i \, a d^{2}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac {{\left (i \, a c^{2} - 2 \, a c d - i \, a d^{2}\right )} \log \left (\tan \left (f x + e\right )^{2} + 1\right )}{c^{4} + 2 \, c^{2} d^{2} + d^{4}} + \frac {2 \, {\left (i \, a c - a d\right )}}{c^{3} + c d^{2} + {\left (c^{2} d + d^{3}\right )} \tan \left (f x + e\right )}}{2 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.86, size = 128, normalized size = 1.71 \begin {gather*} \frac {-2 i \, a d - {\left (a c + i \, a d + {\left (a c - i \, a d\right )} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (\frac {{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{{\left (-i \, c^{3} - 3 \, c^{2} d + 3 i \, c d^{2} + d^{3}\right )} f e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-i \, c^{3} - c^{2} d - i \, c d^{2} - d^{3}\right )} f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 143 vs. \(2 (58) = 116\).
time = 1.67, size = 143, normalized size = 1.91 \begin {gather*} \frac {2 a d}{c^{3} f - i c^{2} d f + c d^{2} f - i d^{3} f + \left (c^{3} f e^{2 i e} - 3 i c^{2} d f e^{2 i e} - 3 c d^{2} f e^{2 i e} + i d^{3} f e^{2 i e}\right ) e^{2 i f x}} - \frac {i a \log {\left (\frac {c + i d}{c e^{2 i e} - i d e^{2 i e}} + e^{2 i f x} \right )}}{f \left (c - i d\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 186 vs. \(2 (70) = 140\).
time = 0.55, size = 186, normalized size = 2.48 \begin {gather*} \frac {2 \, {\left (\frac {a \log \left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - c\right )}{2 i \, c^{2} + 4 \, c d - 2 i \, d^{2}} + \frac {a \log \left (-i \, \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{-i \, c^{2} - 2 \, c d + i \, d^{2}} - \frac {a c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 i \, a d^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - a c^{2}}{-2 \, {\left (-i \, c^{3} - 2 \, c^{2} d + i \, c d^{2}\right )} {\left (c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 2 \, d \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - c\right )}}\right )}}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 5.13, size = 135, normalized size = 1.80 \begin {gather*} -\frac {2\,a\,\mathrm {atan}\left (\frac {\left (c^2+d^2\right )\,1{}\mathrm {i}}{{\left (d+c\,1{}\mathrm {i}\right )}^2}-\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (2\,c^4\,d^2+4\,c^2\,d^4+2\,d^6\right )}{{\left (d+c\,1{}\mathrm {i}\right )}^2\,\left (c^3\,d\,1{}\mathrm {i}-c^2\,d^2+c\,d^3\,1{}\mathrm {i}-d^4\right )}\right )}{f\,{\left (d+c\,1{}\mathrm {i}\right )}^2}+\frac {a\,1{}\mathrm {i}}{d\,f\,\left (\mathrm {tan}\left (e+f\,x\right )+\frac {c}{d}\right )\,\left (c-d\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________